home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10071 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1020 b 

  1. Path: mac007016.shef.ac.uk!user
  2. From: m.b.greenwood@sheffield.ac.uk (Mike Greenwood)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Kind of an annoying question...
  5. Date: Fri, 15 Mar 1996 13:12:51 +0000
  6. Organization: University of Sheffield
  7. Message-ID: <m.b.greenwood-1503961312510001@mac007016.shef.ac.uk>
  8. References: <4hvrio$c4k@lastactionhero.rs.itd.umich.edu> <4iaqd4$l70@cs3.brookes.ac.uk>
  9. NNTP-Posting-Host: mac007016.shef.ac.uk
  10.  
  11. In short, unbuffered keyboard input:
  12.  
  13. > int main(void)
  14. > {
  15. > char choice;
  16. > printf("Do you want to drop an H-Bomb on Iraq (Y or N)");
  17. > choice=getch(); /* vital line */
  18. > if(choice=='Y') start_war();
  19.  
  20. blah blah..
  21.  
  22.  
  23. > Krunchie
  24. > Digital Dynamics - Dynamic Software solutions for a dynamic world.
  25. > 95155580@brookes.ac.uk
  26.  
  27. Hi 
  28.  
  29. ALERT ALERT ALERT !!!!
  30.  
  31. Fine if it works, but getch() is _NOT_ ansi standard. Beware UNIX users,
  32. it's not as simple as all this. See the UNIX FAQ for a cheat way round
  33. this, but I still haven't managed to figure it out the 'proper way'.
  34.  
  35. Regards
  36.  
  37. Mike Greenwood :o)
  38.